Scripts - Format of Script Files Options Section

Below is some detail on the items in the [Expression] and [Options] section of a script. Use this as a guide for manual edits.

It is not necessary to specify all switches in the [Options] section. For example, a sole [Options] item could be Prompt_flag=0.

With the exception of the Script Loop= switch, the [Options] switches for version 3.9 and above can be in any order. If you need to maintain backwards compatibility for use with older versions of Search and Replace, use the order below.

Script Item

Notes & GUI Counterpart

 

 

[Expression]

E1 AND E2

This section is optional. It is

created via the Advanced Dialog.

 

 

[Options]

Search_subdir=

 

0 = No; 1 = Yes. If this switch is not

specified, the current program setting

is used.

 

 

Prompt_flag=

Corresponds to Replace Prompts in

Options-Replace. 0 = Prompt on All; 1

= Prompt on Each File; 2 = No Prompts.

Current program setting is used if

this is not specified.

 

 

One hit=

Corresponds to 'Stop Processing After

First Hit In File' in Options-Search.

0 = No; 1 = Yes. Omit to use current

program setting.

 

 

Count Across Files=

This is for v 4.3+. %n>> and %n<<

counter replacements normally do not

reset with each file. Specify Count

Across Files=1 to cause the program to

reset with each new file instead of

sequencing across files. This switch

must be specified manually with a text

editor. The other choice is Count

Across Files=0, which is the default if

not specified.

 

 

Replace Processing=

For ver 4.4+. See Special Case Handling

for more information. The choices are:

Replace Processing=0 - No special effects.

This is the default if the switch 

is omitted. 

Replace Processing=1 - Capitalize words

during replaces. 

Replace Processing=2 - Match Existing

letter case. 

 

 

Process Binary Files=

For version 5.0+. Search and Replace normally searches any file that meets the file mask/path and filter criteria. If you specify Process Binary Files=0 the program will skip any file it determines is 'binary'. Note that depending your output settings, the file(s) will still be listed. But they will be shown as having no hits.

 

 

Buffer Size=

The size of the memory block (in bytes) used by the program when reading files can be adjusted using this switch. For most uses we suggest leaving this at default or omitting it entirely. The default is 102400. The lowest value permitted is Buffer Size= 1024.

 

Note: Buffer Size may have indirect effect on Max Reg Expr= behavior. If Buffer Size= is set lower than Max Reg Expr= by limiting the size of blocks searched the effective Max Reg Expr= is limited to Buffer Size. The default Max Reg Expr=32767 bytes. If your search requires this span as a minimum, Buffer Size should be at least Buffer Size=32767.

 

 

Num Buffers To Process=

Use this switch to limit the number of blocks to process in each file. The default Num Buffers To Process=0 means all blocks, or the entire file. This switch can be used in conjunction with the Buffer Size= switch above. For example, to search only the first 26,000 bytes of all files specify:

Buffer Size=26000 

Num Buffers To Process=1 

 

Note: If One hit=1 is specified, that switch takes precedence if a hit is found within the number of blocks specified.

 

 

Output_File=

Options-Output. Omit or leave blank if none is to be used.

 

 

Append to output file=0

Corresponds to 'Append to Output File'

in Options-Output. 0 = No; 1 = Yes.

Omit to use current program setting.

 

 

Max Reg Expr=

Options-Search. Determines the maximum

number of characters spanned by regular

expression terms. The range is 50 to

32767.

 

 

Max Display Chars=

Options|Search. Determines the number of

characters to list on each hit line. The

range is 128 to 4069.

 

 

Backup Path=

Options-Replace. If this switch is

included but no file is specified, no

backup path will be used. If not

specified, the program default is

used.

 

 

Write to Backup Dir=

Options-Replace. 0 = No; 1 = Yes

 

 

Unzip Dir=

Options-Search.

 

 

Keep file time stamp=

Corresponds to 'Do not change file

date/time' in Options-Replace. 0 = No;

1 = Yes. Omit to use current program

setting.

 

 

Show Progress Dialog=

Options-Search. Determines whether or not

to display the progress meter.

 

 

Before Hit=

After Hit=

Options-Output. Characters to go before

and after the search hit.

 

 

Show_Files=

Corresponds to 'Display First Hit

Line' in Options-Output. 0 = No; 1 =

Yes. Current program setting is used

if this is not specified.

 

 

Show Files Without Hits=

Corresponds to 'Display Files Without

Hits' in Options-Output. 0 = No; 1 =

Yes. Current program setting is used

if this is not specified.

 

 

Display Replace String=

Corresponds to 'Display Replace

String' in Options-Output. 0 = No; 1 =

Yes. Current program setting is used

if this is not specified.

 

 

Display File Stats=

Corresponds to 'Display Number of Hits

in File' in Options-Output. 0 = No; 1

= Yes. Current program setting is used

if this is not specified.

 

 

Reverse Filters=0

Corresponds to the 'Reverse Filter'

checkbox in Options-Filter. 0= No; 1 =

Yes. Omit to use current program

setting. See Skip Files Mask and

Ignore Attributes below for more info.

 

 

Min Size Filter=

Max Size Filter=

Min Date Filter=

Max Date Filter=

Options-Filter. Omit some or all to

use current program setting. See

Special Date Filter for information on

a special, %%today%% switch.

 

 

Skip Files Mask=0

Ignore Attributes=55

The default values for these two

settings are listed here. These values

are related to the Attributes

checkboxes in Options-Filters. The

number of possible values, in

conjunction with the Reverse Filters

switch above, is extensive and

difficult to explain. Most users will

not have any setting here. If you do

need a special setting, experiment

interactively with Options-Filters

dialog and some file searches. When

you are satisfied, generate an

'SRDUMP.SRS' file and copy the switch

settings into your production script.

You can also write us for help at

support@funduc.com

 

 

Sort File Names=

Corresponds to the 'Sort Results By'

combo list in Options-Search. The

values are: 0 = Unsorted, 1 = File

Name, 2 = File Extension, 3 = File

Date/Time, 4 = File Size, 5 = File

Path. Omit to use current program

setting.

 

 

Sort Ascending=

Corresponds to the Sort Ascending

checkbox in Options-Search. 0 =

Descending, 1 = Ascending. Omit to use

current program setting.

 

 

Line Prefix=

Binary Prefix=

These two switches for for v 4.3+ only.

They are 'read-only' settings for users

who create/edit scripts manually, with

a text editor. If you save a script

with the script editor these switches

will be stripped out. These work with

the English only. Do not use if you are

using a language module. See Line Prefix Switches for more information.

 

 

Script Loop=

Script Iteration Counter. This must be

entered manually. It must be the last

entry in the [Options] section. Also see

Script Repeat Action for information on

how to repeat specific search/replace

strings.